<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">对阵表</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="game-info">
      <el-col :span="3">
        <div>{{ tableData.column1 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-b" style="margin-left:-10px">{{ tableData.column2 }}</div>
      </el-col>
      <el-col :span="3">
        <div class="game-vs">{{ tableData.column3 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-a">
          {{ tableData.column4 }}
        </div>
      </el-col>
    </div>
    <div class="game-table-data">
      <el-row :gutter="24">
        <el-col :span="3" class="col-style-1">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column
              prop="TableNo"
              label="桌号"
              header-align="center"
              align="center"
            ></el-table-column>
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="BibA" label="号码"> </el-table-column>
            <el-table-column label="姓名" min-width="130%">
              <template slot-scope="scope">
                <div style="color:rgba(230,24,71,1)">
                  {{ scope.row.NameA }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="TeamA" label="单位"> </el-table-column>
            <el-table-column
              prop="ScoreA"
              label="积分"
              header-align="center"
              align="center"
            ></el-table-column>
          </el-table>
        </el-col>
        <el-col :span="3" class="col-style">
          <el-table :data="reportData" style="width: 100%" header-align="center">
            <el-table-column prop="" header-align="center">
              <template slot="header" slot-scope="scope">
                <div class="game-vs-logo"></div>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style-2">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column
              prop="ScoreB"
              label="积分"
              header-align="center"
              align="center"
            ></el-table-column>
            <el-table-column label="姓名" min-width="130%">
              <template slot-scope="scope">
                <div style="color:rgba(60,135,247,1)">
                  {{ scope.row.NameB }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="TeamB" label="单位"> </el-table-column>
            <el-table-column prop="BibB" label="号码"> </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </div>
    <div class="game-legend">
      <el-row :gutter="24">
        <el-col :span="6" class="col-6">
          <div class="col-6-title">GM</div>
          <div>国际特级大师</div>
        </el-col>
        <el-col :span="6" class="col-6">
          <div class="col-6-title">WGM</div>
          <div>女子国际特技大师</div></el-col
        >
        <el-col :span="6" class="col-6">
          <div class="col-6-title">IM</div>
          <div>国际大师</div>
        </el-col>
        <el-col :span="6" class="col-6">
          <div class="col-6-title">WIM</div>
          <div>女子国际大师</div>
        </el-col>
      </el-row>
      <el-row :gutter="24" style="margin-top: 5px;">
        <el-col :span="6" class="col-6">
          <div class="col-6-title">FM</div>
          <div>棋联大师</div>
        </el-col>
        <el-col :span="6" class="col-6">
          <div class="col-6-title">WFM</div>
          <div>女子棋联大师</div></el-col
        >
        <el-col :span="6" class="col-6">
          <div class="col-6-title">CM</div>
          <div>候补大师</div></el-col
        >
        <el-col :span="6" class="col-6">
          <div class="col-6-title">WCM</div>
          <div>女子候补大师</div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableData: {
        column1: '对阵',
        column2: '白方',
        column3: 'VS',
        column4: '黑方'
      },
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      startList: [
        {
          TableNo: '1',
          BibA: '35',
          NameA: '房岩',
          TeamA: '湖北',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '丁立人',
          TeamB: '浙江',
          BibB: '1'
        },
        {
          TableNo: '2',
          BibA: '2',
          NameA: '余泱漪',
          TeamA: '北京',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '鲍麒麟',
          TeamB: '黑龙江',
          BibB: '36'
        },
        {
          TableNo: '3',
          BibA: '37',
          NameA: '张子洋',
          TeamA: '河南',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '王皓',
          TeamB: '黑龙江',
          BibB: '3'
        },
        {
          TableNo: '4',
          BibA: '4',
          NameA: '卜祥志',
          TeamA: '山东',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '牟科',
          TeamB: '青岛',
          BibB: '38'
        },
        {
          TableNo: '5',
          BibA: '39',
          NameA: '徐铭辉',
          TeamA: '浙江',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '韦奕',
          TeamB: '江苏',
          BibB: '5'
        },
        {
          TableNo: '6',
          BibA: '6',
          NameA: '李超',
          TeamA: '北京',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '赵晨曦',
          TeamB: '广东',
          BibB: '40'
        },
        {
          TableNo: '7',
          BibA: '41',
          NameA: '林卫国',
          TeamA: '湖北',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '王玥',
          TeamB: '天津',
          BibB: '7'
        },
        {
          TableNo: '8',
          BibA: '8',
          NameA: '倪华',
          TeamA: '上海',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '刘钊杞',
          TeamB: '河北',
          BibB: '42'
        },
        {
          TableNo: '9',
          BibA: '43',
          NameA: '许亦柠',
          TeamA: '上海',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '赵骏',
          TeamB: '山东',
          BibB: '9'
        },
        {
          TableNo: '10',
          BibA: '10',
          NameA: '马群',
          TeamA: '浙江',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '周江南',
          TeamB: '青岛',
          BibB: '44'
        },
        {
          TableNo: '11',
          BibA: '45',
          NameA: '彭红墀',
          TeamA: '河北',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '周健超',
          TeamB: '上海',
          BibB: '11'
        },
        {
          TableNo: '12',
          BibA: '12',
          NameA: '卢尚磊',
          TeamA: '浙江',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '范会丰',
          TeamB: '大连',
          BibB: '46'
        },
        {
          TableNo: '13',
          BibA: '47',
          NameA: '赵洲桥',
          TeamA: '天津',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '周唯奇',
          TeamB: '重庆',
          BibB: '13'
        },
        {
          TableNo: '14',
          BibA: '14',
          NameA: '温阳',
          TeamA: '山东',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '张家宝',
          TeamB: '甘肃',
          BibB: '48'
        },
        {
          TableNo: '15',
          BibA: '49',
          NameA: '吴玺斌',
          TeamA: '黑龙江',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '张鹏翔',
          TeamB: '河北',
          BibB: '15'
        },
        {
          TableNo: '16',
          BibA: '16',
          NameA: '徐英伦',
          TeamA: '广东',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '马麟',
          TeamB: '甘肃',
          BibB: '50'
        },
        {
          TableNo: '17',
          BibA: '51',
          NameA: '李国豪',
          TeamA: '甘肃',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '曾重生',
          TeamB: '重庆',
          BibB: '17'
        },
        {
          TableNo: '18',
          BibA: '18',
          NameA: '李荻',
          TeamA: '四川',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '张晟昀',
          TeamB: '四川',
          BibB: '52'
        },
        {
          TableNo: '19',
          BibA: '53',
          NameA: '孙超',
          TeamA: '甘肃',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '刘庆南',
          TeamB: '山东',
          BibB: '19'
        },
        {
          TableNo: '20',
          BibA: '20',
          NameA: '修德顺',
          TeamA: '北京',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '林培森',
          TeamB: '广东',
          BibB: '54'
        },
        {
          TableNo: '21',
          BibA: '55',
          NameA: '张胤哲',
          TeamA: '河南',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '刘言',
          TeamB: '重庆',
          BibB: '21'
        },
        {
          TableNo: '22',
          BibA: '22',
          NameA: '戴常人',
          TeamA: '天津',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '恩和',
          TeamB: '内蒙古',
          BibB: '56'
        },
        {
          TableNo: '23',
          BibA: '57',
          NameA: '白巴特尔',
          TeamA: '内蒙古',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '万云国',
          TeamB: '河北',
          BibB: '23'
        },
        {
          TableNo: '24',
          BibA: '24',
          NameA: '徐志行',
          TeamA: '青岛',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '陈瑜亮',
          TeamB: '海南',
          BibB: '58'
        },
        {
          TableNo: '25',
          BibA: '59',
          NameA: '呼木吉勒图',
          TeamA: '内蒙古',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '余瑞源',
          TeamB: '江苏',
          BibB: '25'
        },
        {
          TableNo: '26',
          BibA: '26',
          NameA: '林晨',
          TeamA: '江苏',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '刘将',
          TeamB: '西藏',
          BibB: '60'
        },
        {
          TableNo: '27',
          BibA: '61',
          NameA: '鲁宽',
          TeamA: '江西',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '汪自力',
          TeamB: '深圳',
          BibB: '27'
        },
        {
          TableNo: '28',
          BibA: '28',
          NameA: '王晨',
          TeamA: '重庆',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '史一凯',
          TeamB: '宁波',
          BibB: '62'
        },
        {
          TableNo: '29',
          BibA: '63',
          NameA: '图木尔巴根',
          TeamA: '内蒙古',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '马中涵',
          TeamB: '青岛',
          BibB: '29'
        },
        {
          TableNo: '30',
          BibA: '30',
          NameA: '楼一平',
          TeamA: '上海',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '王飞',
          TeamB: '河南',
          BibB: '64'
        },
        {
          TableNo: '31',
          BibA: '65',
          NameA: '王鸿',
          TeamA: '江西',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '王一业',
          TeamB: '黑龙江',
          BibB: '31'
        },
        {
          TableNo: '32',
          BibA: '32',
          NameA: '李师龙',
          TeamA: '广东',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '汪进',
          TeamB: '江西',
          BibB: '66'
        },
        {
          TableNo: '33',
          BibA: '67',
          NameA: '张海威',
          TeamA: '福建',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '陈琪',
          TeamB: '江苏',
          BibB: '33'
        },
        {
          TableNo: '34',
          BibA: '34',
          NameA: '刘冠初',
          TeamA: '四川',
          ScoreA: '0',
          Result: null,
          ScoreB: '0',
          NameB: '张少峰',
          TeamB: '青海',
          BibB: '68'
        },
        {
          TableNo: '',
          BibA: '69',
          NameA: '邹智平',
          TeamA: '江西',
          ScoreA: '0',
          Result: null,
          ScoreB: null,
          NameB: 'Bye',
          TeamB: null,
          BibB: null
        }
      ],
      singleItemList: [
        {
          name: '国际象棋',
          logo: require('@/assets/img/daily/CH.png'),
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
